import React, {Component,PropTypes} from 'react';
import { Dropdown, Button, Icon, Menu } from 'antd'

const DropOption = ({ onMenuClick, menuOptions = [], buttonStyle, dropdownProps }) => {
	const menu = menuOptions.map(item => <Menu.Item key={item.key}>{item.name}</Menu.Item>)
	return (<Dropdown
		overlay={<Menu onClick={onMenuClick}>{menu}</Menu>}
		{...dropdownProps}
	>
		<Button style={{ border: 'none', ...buttonStyle }}>
			{
				menuOptions[0].key == '8'?'导入持仓':'更多'
			}
			<Icon type="down" />
		</Button>
	</Dropdown>)
}

DropOption.propTypes = {
	onMenuClick: PropTypes.func,
	menuOptions: PropTypes.array.isRequired,
	buttonStyle: PropTypes.object,
	dropdownProps: PropTypes.object,
}

export default DropOption